unit td_Area;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, BaseTreeForm, StdCtrls, ComCtrls, ExtCtrls, DB, Buttons,
  Menus, ImgList, ToolWin, cxGraphics, cxLookAndFeels,
  cxLookAndFeelPainters, cxControls, cxContainer, cxEdit,
  dxSkinsCore, dxSkinsDefaultPainters, cxMaskEdit, cxDropDownEdit,
  cxTextEdit, MisString, dxSkinsForm, cxLabel, System.ImageList, cxButtons;

type
  TFrmtd_Area = class(TfrmBaseTreeForm)
    Label2: TLabel;
    edtAreacode: TcxTextEdit;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  protected
    procedure AfterScroll(DataSet: TDataSet);            override;
    procedure SetControlEnable(p_dsState: TDataSetState);override;
    procedure AddFieldsEdit;override;
  public
    { Public declarations }
  end;

var
  Frmtd_Area: TFrmtd_Area;

implementation


{$R *.dfm}

procedure TFrmtd_Area.FormCreate(Sender: TObject);
begin
  TableName  := 'td_Area';
  inherited;
end;

procedure Tfrmtd_Area.AfterScroll(DataSet: TDataSet);
begin
  inherited;
  edtAreacode.Text := Trim(DataSet.fieldbyname('areacode').AsString);
end;  

procedure Tfrmtd_Area.SetControlEnable(p_dsState: TDataSetState);
begin
  inherited;
  edtAreacode.Enabled := (p_dsState in [dsInsert ,dsEdit]);
end;

procedure Tfrmtd_Area.AddFieldsEdit;
begin
  ADODataSet.fieldbyname('areacode').asstring := Trim(edtareacode.text);
end;  

end.
